package com.yjd.comm.device.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.device.model.DeviceModel;
import com.yjd.comm.user.dto.UserSession;

/**
 * <b>description</b>：标的信息业务接口<br>
 * <b>time</b>：2015-01-27 12:28:26 <br>
 * <b>author</b>：  renbangjie
 */
public interface IDeviceService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public DeviceModel insert(DeviceModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(DeviceModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param device_id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long device_id) throws Exception;
	
	/**
	 * 根据设备号查询设备信息
	* @param DeviceNo 设备号
	* @return DeviceModel
	 * @throws Exception 
	 */
	public DeviceModel getDeviceModelByDeviceNo(String DeviceNo) throws Exception;
	
	
	/**
	 * 根据设备号查询设备信息
	* @param DeviceNo 设备号
	* @return DeviceModel
	 * @throws Exception 
	 */
	public DeviceModel getDeviceModelByUser(Long idUser) throws Exception;
	
	/**
	 * 更新设备状态
	* @param deviceModel
	* @return boolean
	 */
	public boolean updateDeviceStatus(DeviceModel deviceModel);
	
	/**
	 * 更新设备号
	* @param deviceModel
	* @return
	* boolean
	 * @throws Exception 
	 */
	public boolean updateDeviceNo(Long deviceId, String deviceNo) throws Exception;
	
	/**
	 * 获取已登录用户的详细信息
	* @param idUser
	* @return
	* MobileUserSession
	 */
	public UserSession getMobileUser(Long idUser);

}
